3.2.57 \(\int \csc (e+f x) (a+b \tan ^2(e+f x))^p \, dx\) [157]

Optimal. Leaf size=88 \[ -\frac {F_1\left (\frac {1}{2};1,-p;\frac {3}{2};\sec ^2(e+f x),-\frac {b \sec ^2(e+f x)}{a-b}\right ) \sec (e+f x) \left (a-b+b \sec ^2(e+f x)\right )^p \left (1+\frac {b \sec ^2(e+f x)}{a-b}\right )^{-p}}{f} \]

[Out]

-AppellF1(1/2,1,-p,3/2,sec(f*x+e)^2,-b*sec(f*x+e)^2/(a-b))*sec(f*x+e)*(a-b+b*sec(f*x+e)^2)^p/f/((1+b*sec(f*x+e
)^2/(a-b))^p)

________________________________________________________________________________________

Rubi [A]
time = 0.06, antiderivative size = 88, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {3745, 441, 440} \begin {gather*} -\frac {\sec (e+f x) \left (a+b \sec ^2(e+f x)-b\right )^p \left (\frac {b \sec ^2(e+f x)}{a-b}+1\right )^{-p} F_1\left (\frac {1}{2};1,-p;\frac {3}{2};\sec ^2(e+f x),-\frac {b \sec ^2(e+f x)}{a-b}\right )}{f} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Csc[e + f*x]*(a + b*Tan[e + f*x]^2)^p,x]

[Out]

-((AppellF1[1/2, 1, -p, 3/2, Sec[e + f*x]^2, -((b*Sec[e + f*x]^2)/(a - b))]*Sec[e + f*x]*(a - b + b*Sec[e + f*
x]^2)^p)/(f*(1 + (b*Sec[e + f*x]^2)/(a - b))^p))

Rule 440

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_), x_Symbol] :> Simp[a^p*c^q*x*AppellF1[1/n, -p,
 -q, 1 + 1/n, (-b)*(x^n/a), (-d)*(x^n/c)], x] /; FreeQ[{a, b, c, d, n, p, q}, x] && NeQ[b*c - a*d, 0] && NeQ[n
, -1] && (IntegerQ[p] || GtQ[a, 0]) && (IntegerQ[q] || GtQ[c, 0])

Rule 441

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_), x_Symbol] :> Dist[a^IntPart[p]*((a + b*x^n)^F
racPart[p]/(1 + b*(x^n/a))^FracPart[p]), Int[(1 + b*(x^n/a))^p*(c + d*x^n)^q, x], x] /; FreeQ[{a, b, c, d, n,
p, q}, x] && NeQ[b*c - a*d, 0] && NeQ[n, -1] &&  !(IntegerQ[p] || GtQ[a, 0])

Rule 3745

Int[sin[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]^2)^(p_.), x_Symbol] :> With[{ff = Free
Factors[Sec[e + f*x], x]}, Dist[1/(f*ff^m), Subst[Int[(-1 + ff^2*x^2)^((m - 1)/2)*((a - b + b*ff^2*x^2)^p/x^(m
 + 1)), x], x, Sec[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f, p}, x] && IntegerQ[(m - 1)/2]

Rubi steps

\begin {align*} \int \csc (e+f x) \left (a+b \tan ^2(e+f x)\right )^p \, dx &=\frac {\text {Subst}\left (\int \frac {\left (a-b+b x^2\right )^p}{-1+x^2} \, dx,x,\sec (e+f x)\right )}{f}\\ &=\frac {\left (\left (a-b+b \sec ^2(e+f x)\right )^p \left (1+\frac {b \sec ^2(e+f x)}{a-b}\right )^{-p}\right ) \text {Subst}\left (\int \frac {\left (1+\frac {b x^2}{a-b}\right )^p}{-1+x^2} \, dx,x,\sec (e+f x)\right )}{f}\\ &=-\frac {F_1\left (\frac {1}{2};1,-p;\frac {3}{2};\sec ^2(e+f x),-\frac {b \sec ^2(e+f x)}{a-b}\right ) \sec (e+f x) \left (a-b+b \sec ^2(e+f x)\right )^p \left (1+\frac {b \sec ^2(e+f x)}{a-b}\right )^{-p}}{f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(1215\) vs. \(2(88)=176\).
time = 14.07, size = 1215, normalized size = 13.81 \begin {gather*} \frac {\csc (e+f x) \left (a+b \tan ^2(e+f x)\right )^{2 p} \left (\frac {2 F_1\left (-\frac {1}{2}-p;-\frac {1}{2},-p;\frac {1}{2}-p;-\cot ^2(e+f x),-\frac {a \cot ^2(e+f x)}{b}\right ) \left (1+\frac {a \cot ^2(e+f x)}{b}\right )^{-p} \sqrt {\sec ^2(e+f x)}}{(1+2 p) \sqrt {\csc ^2(e+f x)}}-F_1\left (1;\frac {1}{2},-p;2;-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a}\right ) \tan ^2(e+f x) \left (1+\frac {b \tan ^2(e+f x)}{a}\right )^{-p}\right )}{2 f \left (b p \sec ^2(e+f x) \tan (e+f x) \left (a+b \tan ^2(e+f x)\right )^{-1+p} \left (\frac {2 F_1\left (-\frac {1}{2}-p;-\frac {1}{2},-p;\frac {1}{2}-p;-\cot ^2(e+f x),-\frac {a \cot ^2(e+f x)}{b}\right ) \left (1+\frac {a \cot ^2(e+f x)}{b}\right )^{-p} \sqrt {\sec ^2(e+f x)}}{(1+2 p) \sqrt {\csc ^2(e+f x)}}-F_1\left (1;\frac {1}{2},-p;2;-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a}\right ) \tan ^2(e+f x) \left (1+\frac {b \tan ^2(e+f x)}{a}\right )^{-p}\right )+\frac {1}{2} \left (a+b \tan ^2(e+f x)\right )^p \left (\frac {2 F_1\left (-\frac {1}{2}-p;-\frac {1}{2},-p;\frac {1}{2}-p;-\cot ^2(e+f x),-\frac {a \cot ^2(e+f x)}{b}\right ) \cot (e+f x) \left (1+\frac {a \cot ^2(e+f x)}{b}\right )^{-p} \sqrt {\sec ^2(e+f x)}}{(1+2 p) \sqrt {\csc ^2(e+f x)}}+\frac {4 a p F_1\left (-\frac {1}{2}-p;-\frac {1}{2},-p;\frac {1}{2}-p;-\cot ^2(e+f x),-\frac {a \cot ^2(e+f x)}{b}\right ) \cot (e+f x) \left (1+\frac {a \cot ^2(e+f x)}{b}\right )^{-1-p} \sqrt {\csc ^2(e+f x)} \sqrt {\sec ^2(e+f x)}}{b (1+2 p)}+\frac {2 \left (1+\frac {a \cot ^2(e+f x)}{b}\right )^{-p} \left (-\frac {2 a \left (-\frac {1}{2}-p\right ) p F_1\left (\frac {1}{2}-p;-\frac {1}{2},1-p;\frac {3}{2}-p;-\cot ^2(e+f x),-\frac {a \cot ^2(e+f x)}{b}\right ) \cot (e+f x) \csc ^2(e+f x)}{b \left (\frac {1}{2}-p\right )}-\frac {\left (-\frac {1}{2}-p\right ) F_1\left (\frac {1}{2}-p;\frac {1}{2},-p;\frac {3}{2}-p;-\cot ^2(e+f x),-\frac {a \cot ^2(e+f x)}{b}\right ) \cot (e+f x) \csc ^2(e+f x)}{\frac {1}{2}-p}\right ) \sqrt {\sec ^2(e+f x)}}{(1+2 p) \sqrt {\csc ^2(e+f x)}}+\frac {2 F_1\left (-\frac {1}{2}-p;-\frac {1}{2},-p;\frac {1}{2}-p;-\cot ^2(e+f x),-\frac {a \cot ^2(e+f x)}{b}\right ) \left (1+\frac {a \cot ^2(e+f x)}{b}\right )^{-p} \sqrt {\sec ^2(e+f x)} \tan (e+f x)}{(1+2 p) \sqrt {\csc ^2(e+f x)}}+\frac {2 b p F_1\left (1;\frac {1}{2},-p;2;-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a}\right ) \sec ^2(e+f x) \tan ^3(e+f x) \left (1+\frac {b \tan ^2(e+f x)}{a}\right )^{-1-p}}{a}-2 F_1\left (1;\frac {1}{2},-p;2;-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a}\right ) \sec ^2(e+f x) \tan (e+f x) \left (1+\frac {b \tan ^2(e+f x)}{a}\right )^{-p}-\tan ^2(e+f x) \left (\frac {b p F_1\left (2;\frac {1}{2},1-p;3;-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a}\right ) \sec ^2(e+f x) \tan (e+f x)}{a}-\frac {1}{2} F_1\left (2;\frac {3}{2},-p;3;-\tan ^2(e+f x),-\frac {b \tan ^2(e+f x)}{a}\right ) \sec ^2(e+f x) \tan (e+f x)\right ) \left (1+\frac {b \tan ^2(e+f x)}{a}\right )^{-p}\right )\right )} \end {gather*}

Warning: Unable to verify antiderivative.

[In]

Integrate[Csc[e + f*x]*(a + b*Tan[e + f*x]^2)^p,x]

[Out]

(Csc[e + f*x]*(a + b*Tan[e + f*x]^2)^(2*p)*((2*AppellF1[-1/2 - p, -1/2, -p, 1/2 - p, -Cot[e + f*x]^2, -((a*Cot
[e + f*x]^2)/b)]*Sqrt[Sec[e + f*x]^2])/((1 + 2*p)*(1 + (a*Cot[e + f*x]^2)/b)^p*Sqrt[Csc[e + f*x]^2]) - (Appell
F1[1, 1/2, -p, 2, -Tan[e + f*x]^2, -((b*Tan[e + f*x]^2)/a)]*Tan[e + f*x]^2)/(1 + (b*Tan[e + f*x]^2)/a)^p))/(2*
f*(b*p*Sec[e + f*x]^2*Tan[e + f*x]*(a + b*Tan[e + f*x]^2)^(-1 + p)*((2*AppellF1[-1/2 - p, -1/2, -p, 1/2 - p, -
Cot[e + f*x]^2, -((a*Cot[e + f*x]^2)/b)]*Sqrt[Sec[e + f*x]^2])/((1 + 2*p)*(1 + (a*Cot[e + f*x]^2)/b)^p*Sqrt[Cs
c[e + f*x]^2]) - (AppellF1[1, 1/2, -p, 2, -Tan[e + f*x]^2, -((b*Tan[e + f*x]^2)/a)]*Tan[e + f*x]^2)/(1 + (b*Ta
n[e + f*x]^2)/a)^p) + ((a + b*Tan[e + f*x]^2)^p*((2*AppellF1[-1/2 - p, -1/2, -p, 1/2 - p, -Cot[e + f*x]^2, -((
a*Cot[e + f*x]^2)/b)]*Cot[e + f*x]*Sqrt[Sec[e + f*x]^2])/((1 + 2*p)*(1 + (a*Cot[e + f*x]^2)/b)^p*Sqrt[Csc[e +
f*x]^2]) + (4*a*p*AppellF1[-1/2 - p, -1/2, -p, 1/2 - p, -Cot[e + f*x]^2, -((a*Cot[e + f*x]^2)/b)]*Cot[e + f*x]
*(1 + (a*Cot[e + f*x]^2)/b)^(-1 - p)*Sqrt[Csc[e + f*x]^2]*Sqrt[Sec[e + f*x]^2])/(b*(1 + 2*p)) + (2*((-2*a*(-1/
2 - p)*p*AppellF1[1/2 - p, -1/2, 1 - p, 3/2 - p, -Cot[e + f*x]^2, -((a*Cot[e + f*x]^2)/b)]*Cot[e + f*x]*Csc[e
+ f*x]^2)/(b*(1/2 - p)) - ((-1/2 - p)*AppellF1[1/2 - p, 1/2, -p, 3/2 - p, -Cot[e + f*x]^2, -((a*Cot[e + f*x]^2
)/b)]*Cot[e + f*x]*Csc[e + f*x]^2)/(1/2 - p))*Sqrt[Sec[e + f*x]^2])/((1 + 2*p)*(1 + (a*Cot[e + f*x]^2)/b)^p*Sq
rt[Csc[e + f*x]^2]) + (2*AppellF1[-1/2 - p, -1/2, -p, 1/2 - p, -Cot[e + f*x]^2, -((a*Cot[e + f*x]^2)/b)]*Sqrt[
Sec[e + f*x]^2]*Tan[e + f*x])/((1 + 2*p)*(1 + (a*Cot[e + f*x]^2)/b)^p*Sqrt[Csc[e + f*x]^2]) + (2*b*p*AppellF1[
1, 1/2, -p, 2, -Tan[e + f*x]^2, -((b*Tan[e + f*x]^2)/a)]*Sec[e + f*x]^2*Tan[e + f*x]^3*(1 + (b*Tan[e + f*x]^2)
/a)^(-1 - p))/a - (2*AppellF1[1, 1/2, -p, 2, -Tan[e + f*x]^2, -((b*Tan[e + f*x]^2)/a)]*Sec[e + f*x]^2*Tan[e +
f*x])/(1 + (b*Tan[e + f*x]^2)/a)^p - (Tan[e + f*x]^2*((b*p*AppellF1[2, 1/2, 1 - p, 3, -Tan[e + f*x]^2, -((b*Ta
n[e + f*x]^2)/a)]*Sec[e + f*x]^2*Tan[e + f*x])/a - (AppellF1[2, 3/2, -p, 3, -Tan[e + f*x]^2, -((b*Tan[e + f*x]
^2)/a)]*Sec[e + f*x]^2*Tan[e + f*x])/2))/(1 + (b*Tan[e + f*x]^2)/a)^p))/2))

________________________________________________________________________________________

Maple [F]
time = 0.21, size = 0, normalized size = 0.00 \[\int \csc \left (f x +e \right ) \left (a +b \left (\tan ^{2}\left (f x +e \right )\right )\right )^{p}\, dx\]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(csc(f*x+e)*(a+b*tan(f*x+e)^2)^p,x)

[Out]

int(csc(f*x+e)*(a+b*tan(f*x+e)^2)^p,x)

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)*(a+b*tan(f*x+e)^2)^p,x, algorithm="maxima")

[Out]

integrate((b*tan(f*x + e)^2 + a)^p*csc(f*x + e), x)

________________________________________________________________________________________

Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)*(a+b*tan(f*x+e)^2)^p,x, algorithm="fricas")

[Out]

integral((b*tan(f*x + e)^2 + a)^p*csc(f*x + e), x)

________________________________________________________________________________________

Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)*(a+b*tan(f*x+e)**2)**p,x)

[Out]

Timed out

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)*(a+b*tan(f*x+e)^2)^p,x, algorithm="giac")

[Out]

integrate((b*tan(f*x + e)^2 + a)^p*csc(f*x + e), x)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {{\left (b\,{\mathrm {tan}\left (e+f\,x\right )}^2+a\right )}^p}{\sin \left (e+f\,x\right )} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + b*tan(e + f*x)^2)^p/sin(e + f*x),x)

[Out]

int((a + b*tan(e + f*x)^2)^p/sin(e + f*x), x)

________________________________________________________________________________________